package com.itcast.controller;


import com.itcast.pojo.Type;
import com.itcast.service.Typeservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2020-06-19
 */
@Controller
@RequestMapping("/type")
public class TypeController {
    @Autowired
    Typeservice typeservice;

    /**
     * @return 所有商品类型
     */
    @ResponseBody
    @RequestMapping("/getAllType")
    public List<Type> getAllType(){
        return typeservice.getAllType();
    }
}
